From e9542d25deafb3c0e4ab376765de9d51c8f45117 Mon Sep 17 00:00:00 2001 From: "kfraser@localhost.localdomain" Date: Mon, 27 Nov 2006 10:02:24 +0000 Subject: [PATCH] [HVM] Fix building PV-on-HVM drivers on i386. Signed-off-by: Keir Fraser --- .../include/asm-i386/mach-xen/asm/maddr.h | 42 ++++++++++--------- .../include/asm-x86_64/mach-xen/asm/maddr.h | 31 +++++++------- 2 files changed, 39 insertions(+), 34 deletions(-) diff --git a/linux-2.6-xen-sparse/include/asm-i386/mach-xen/asm/maddr.h b/linux-2.6-xen-sparse/include/asm-i386/mach-xen/asm/maddr.h index 3916c4ba9e..f805d6ea60 100644 --- a/linux-2.6-xen-sparse/include/asm-i386/mach-xen/asm/maddr.h +++ b/linux-2.6-xen-sparse/include/asm-i386/mach-xen/asm/maddr.h @@ -9,6 +9,15 @@ #define FOREIGN_FRAME_BIT (1UL<<31) #define FOREIGN_FRAME(m) ((m) | FOREIGN_FRAME_BIT) +/* Definitions for machine and pseudophysical addresses. */ +#ifdef CONFIG_X86_PAE +typedef unsigned long long paddr_t; +typedef unsigned long long maddr_t; +#else +typedef unsigned long paddr_t; +typedef unsigned long maddr_t; +#endif + #ifdef CONFIG_XEN extern unsigned long *phys_to_machine_mapping; @@ -101,26 +110,6 @@ static inline void set_phys_to_machine(unsigned long pfn, unsigned long mfn) phys_to_machine_mapping[pfn] = mfn; } - -#else /* !CONFIG_XEN */ - -#define pfn_to_mfn(pfn) (pfn) -#define mfn_to_pfn(mfn) (mfn) -#define mfn_to_local_pfn(mfn) (mfn) -#define set_phys_to_machine(pfn, mfn) BUG_ON((pfn) != (mfn)) -#define phys_to_machine_mapping_valid(pfn) (1) - -#endif /* !CONFIG_XEN */ - -/* Definitions for machine and pseudophysical addresses. */ -#ifdef CONFIG_X86_PAE -typedef unsigned long long paddr_t; -typedef unsigned long long maddr_t; -#else -typedef unsigned long paddr_t; -typedef unsigned long maddr_t; -#endif - static inline maddr_t phys_to_machine(paddr_t phys) { maddr_t machine = pfn_to_mfn(phys >> PAGE_SHIFT); @@ -148,6 +137,19 @@ static inline paddr_t pte_machine_to_phys(maddr_t machine) return phys; } +#else /* !CONFIG_XEN */ + +#define pfn_to_mfn(pfn) (pfn) +#define mfn_to_pfn(mfn) (mfn) +#define mfn_to_local_pfn(mfn) (mfn) +#define set_phys_to_machine(pfn, mfn) BUG_ON((pfn) != (mfn)) +#define phys_to_machine_mapping_valid(pfn) (1) +#define phys_to_machine(phys) ((maddr_t)(phys)) +#define machine_to_phys(mach) ((paddr_t)(mach)) +#define pte_machine_to_phys(mach) ((paddr_t)(mach)) + +#endif /* !CONFIG_XEN */ + /* VIRT <-> MACHINE conversion */ #define virt_to_machine(v) (phys_to_machine(__pa(v))) #define virt_to_mfn(v) (pfn_to_mfn(__pa(v) >> PAGE_SHIFT)) diff --git a/linux-2.6-xen-sparse/include/asm-x86_64/mach-xen/asm/maddr.h b/linux-2.6-xen-sparse/include/asm-x86_64/mach-xen/asm/maddr.h index 83e4336449..77544b3ca2 100644 --- a/linux-2.6-xen-sparse/include/asm-x86_64/mach-xen/asm/maddr.h +++ b/linux-2.6-xen-sparse/include/asm-x86_64/mach-xen/asm/maddr.h @@ -9,6 +9,10 @@ #define FOREIGN_FRAME_BIT (1UL<<63) #define FOREIGN_FRAME(m) ((m) | FOREIGN_FRAME_BIT) +/* Definitions for machine and pseudophysical addresses. */ +typedef unsigned long paddr_t; +typedef unsigned long maddr_t; + #ifdef CONFIG_XEN extern unsigned long *phys_to_machine_mapping; @@ -99,20 +103,6 @@ static inline void set_phys_to_machine(unsigned long pfn, unsigned long mfn) phys_to_machine_mapping[pfn] = mfn; } -#else /* !CONFIG_XEN */ - -#define pfn_to_mfn(pfn) (pfn) -#define mfn_to_pfn(mfn) (mfn) -#define mfn_to_local_pfn(mfn) (mfn) -#define set_phys_to_machine(pfn, mfn) BUG_ON((pfn) != (mfn)) -#define phys_to_machine_mapping_valid(pfn) (1) - -#endif /* !CONFIG_XEN */ - -/* Definitions for machine and pseudophysical addresses. */ -typedef unsigned long paddr_t; -typedef unsigned long maddr_t; - static inline maddr_t phys_to_machine(paddr_t phys) { maddr_t machine = pfn_to_mfn(phys >> PAGE_SHIFT); @@ -135,6 +125,19 @@ static inline paddr_t pte_machine_to_phys(maddr_t machine) return phys; } +#else /* !CONFIG_XEN */ + +#define pfn_to_mfn(pfn) (pfn) +#define mfn_to_pfn(mfn) (mfn) +#define mfn_to_local_pfn(mfn) (mfn) +#define set_phys_to_machine(pfn, mfn) BUG_ON((pfn) != (mfn)) +#define phys_to_machine_mapping_valid(pfn) (1) +#define phys_to_machine(phys) ((maddr_t)(phys)) +#define machine_to_phys(mach) ((paddr_t)(mach)) +#define pte_machine_to_phys(mach) ((paddr_t)(mach)) + +#endif /* !CONFIG_XEN */ + /* VIRT <-> MACHINE conversion */ #define virt_to_machine(v) (phys_to_machine(__pa(v))) #define virt_to_mfn(v) (pfn_to_mfn(__pa(v) >> PAGE_SHIFT)) -- 2.30.2